package com.ytjj.common.enums;

import lombok.Getter;

@Getter
public enum AlipayExpressEnum {

    YUAN_TONG_FAST("圆通速递", "yuantong","YTO"),

    YUN_DA("韵达快递", "yunda","YUNDA"),
    YUN_DA_KUAI_YUN("韵达快运", "yundakuaiyun","YUNDA"),
    FENG_WANG("丰网速运", "fengwang","FENGWANG"),
    ZHONG_TONG("中通快递", "zhongtong",""),
    ZHONG_TONG_KUAI_YUN("中通快运", "happylink","ZTOKY"),
    SHENG_TONG("申通快递", "shentong","ZTO"),
    JI_TU("极兔速递", "jtexpress","JT"),
    ZHONG_TONG_GUO_NEI("邮政快递包裹", "youzhengguonei","POST"),
    EMS("EMS", "ems","EMS"),
    YOU_ZHENG_BK("邮政标准快递", "youzhengbk","POSTB"),
    EMS_GUO_JI("EMS-国际件", "emsguoji","EYB"),
    SUN_FENG_FAST("顺丰速运", "shunfeng","SF"),
    SUN_FENG_KUAI_YUN("顺丰快运", "shunfengkuaiyun","SFISTD"),
    JING_DONG("京东物流", "jd","JD"),
    JING_DONG_KUAI_YUN("京东快运", "jingdongkuaiyun","JD"),
    JIE_BANG_KUAIDI("德邦快递", "debangkuaidi","DBKD"),
    JIE_BANG("德邦", "debangwuliu","DBL"),
    ZHONG_YOU_EX("众邮快递", "zhongyouex","UCS"),
    SU_TENG("速腾快递", "suteng",""),
    ZAI_JI_SONG("宅急送", "zhaijisong","ZJS"),
    BAI_SHI("百世快递", "huitongkuaidi","HTKY"),
    BAI_SHI_KUAI_YUN("百世快运", "baishiwuliu","BEST"),
    ;


    /**
     * 快递中文名
     */
    private String expressName;

    /**
     * 快递编码
     */
    private String expressCode;

    /**
     * 快递编码
     */
    private String alipayExpressCode;


    AlipayExpressEnum(String expressName, String expressCode,String alipayExpressCode) {
        this.expressName = expressName;
        this.expressCode = expressCode;
        this.alipayExpressCode = alipayExpressCode;
    }

    /**
     * 获取快递编码
     *
     * @param expressCode
     * @return
     */
    public static String getAlipayExpressCode(String expressCode) {
        AlipayExpressEnum[] values = AlipayExpressEnum.values();
        for (AlipayExpressEnum expressEnum : values) {
            if(expressEnum.getExpressCode().equals(expressCode)) {
                return expressEnum.getAlipayExpressCode();
            }
        }
        return null;
    }

    /**
     * 获取快递编码
     *
     * @param expressName
     * @return
     */
    public static String getAlipayExpressCodeByName(String expressName) {
        AlipayExpressEnum[] values = AlipayExpressEnum.values();
        for (AlipayExpressEnum expressEnum : values) {
            if(expressEnum.getExpressName().equals(expressName)) {
                return expressEnum.getAlipayExpressCode();
            }
        }
        return null;
    }


}
